package com.jrx.anytxn.atom.bean;

import com.jrx.anytxn.common.annotation.MethodType;
import com.jrx.anytxn.common.constant.CommonContants;
import com.jrx.anytxn.customer.entity.CmCustomerFirstLevel;
import com.jrx.anytxn.investor.entity.*;
import com.jrx.anytxn.transaction.entity.*;
import org.apache.commons.collections.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 客户跑批处理对象 目标为所有继承BaseBatchAccoutHandle的处理类 无需关心处理的数据从哪来，处理完业务后如何处理
 * 该对象分整体为3个部分
 * 最终需要保存的对象即所有save打头的属性
 * 最终需要更新的对象即所有update打头的属性
 * 运行中实时处理对象即所有deal打头的属性 所有任务处理类的处理源数据
 * @program: anytxn-cf-parent
 * @description:
 * @author: xiaoyu.jing
 * @date: 2020-08-31 10:41
 **/
public class CustBatchSaveBean {

    /**
     * 实时处理的客户
     */
    private CmCustomerFirstLevel dealCust;

    /**
     * 需要更新的客户
     */
    private CmCustomerFirstLevel updateCust;

    /**
     * 实时处理的订单信息
     */
    private List<AmLoanMainInfo> dealLoanMainList = new ArrayList<>();

    /**
     * 需要保存的订单账户
     */
    private List<AmLoanAccountInfo> saveLoanAccountList = new ArrayList<>();

    /**
     * 需要更新的订单账户
     */
    private List<AmLoanAccountInfo> updateLoanAccountList = new ArrayList<>();

    /**
     * 实时处理的订单账户
     */
    private List<AmLoanAccountInfo> dealLoanAccountList = new ArrayList<>();

    /**
     * 需要保存的还款计划
     */
    private List<AmRepaymentPlanInfo> savePlanList = new ArrayList<>();

    /**
     * 需要更新的还款计划
     */
    private List<AmRepaymentPlanInfo> updatePlanList = new ArrayList<>();

    /**
     * 实时处理的还款计划
     */
    private List<AmRepaymentPlanInfo> dealPlanList = new ArrayList<>();

    /**
     * 需要保存的贴息还款计划
     */
    private List<AmWaiveRepaymentPlanInfo> saveWaivePlanList = new ArrayList<>();

    /**
     * 需要更新的贴息还款计划
     */
    private List<AmWaiveRepaymentPlanInfo> updateWaivePlanList = new ArrayList<>();

    /**
     * 实时处理的贴息还款计划
     */
    private List<AmWaiveRepaymentPlanInfo> dealWaivePlanList = new ArrayList<>();

    /**
     * 需要保存的交易账户
     */
    private List<AmAccountMainInfo> saveAcctList = new ArrayList<>();

    /**
     * 需要更新的交易账户
     */
    private List<AmAccountMainInfo> updateAcctList = new ArrayList<>();

    /**
     * 实时处理的交易账户
     */
    private List<AmAccountMainInfo> dealAcctList = new ArrayList<>();

    /**
     * 需要保存的累计账户
     */
    private List<AmInterestAccrualInfo> saveAccuAcctList = new ArrayList<>();

    /**
     * 需要更新的累计账户
     */
    private List<AmInterestAccrualInfo> updateAccuAcctList = new ArrayList<>();

    /**
     * 实时处理的累计账户
     */
    private List<AmInterestAccrualInfo> dealAccuAcctList = new ArrayList<>();

    /**
     * 需要保存的延滞交易账户
     */
    private List<AmDelinquencyInfo> saveDelqAcctList = new ArrayList<>();

    /**
     * 需要更新的延滞交易账户
     */
    private List<AmDelinquencyInfo> updateDelqAcctList = new ArrayList<>();

    /**
     * 实时处理的延滞交易账户
     */
    private List<AmDelinquencyInfo> dealDelqAcctList = new ArrayList<>();

    /**
     * 需要保存的gl流水
     */
    private List<TlGlInterfaceInfo> saveGlList = new ArrayList<>();

    /**
     * 需要保存的五级分类变动记录
     */
    private List<TlLoanClassifyChange> saveClassifyList = new ArrayList<>();

    /**
     * 需要保存的交易流水
     */
    private List<TlTransactionInfo> saveTlTransList = new ArrayList<>();

    /**
     * 需要保存的计提日志信息
     */
    private List<TlInterestAccrualLog> saveIntrAccrualLogList = new ArrayList<>();

    /**
     * 实时处理的资金方订单信息
     */
    private List<AmLoanMainInvestorInfo> dealInvestorLoanMainList = new ArrayList<>();

    /**
     * 需要保存的资金方订单账户
     */
    private List<AmLoanAccountInvestorInfo> saveInvestorLoanAccountList = new ArrayList<>();

    /**
     * 需要更新的资金方订单账户
     */
    private List<AmLoanAccountInvestorInfo> updateInvestorLoanAccountList = new ArrayList<>();

    /**
     * 实时处理的资金方订单账户
     */
    private List<AmLoanAccountInvestorInfo> dealInvestorLoanAccountList = new ArrayList<>();

    /**
     * 需要保存的资金方还款计划
     */
    private List<AmRepaymentPlanInvestorInfo> saveInvestorPlanList = new ArrayList<>();

    /**
     * 需要更新的资金方还款计划
     */
    private List<AmRepaymentPlanInvestorInfo> updateInvestorPlanList = new ArrayList<>();

    /**
     * 实时处理的资金方还款计划
     */
    private List<AmRepaymentPlanInvestorInfo> dealInvestorPlanList = new ArrayList<>();

    /**
     * 需要保存的资金方交易账户
     */
    private List<AmAccountMainInvestorInfo> saveInvestorAcctList = new ArrayList<>();

    /**
     * 需要更新的资金方交易账户
     */
    private List<AmAccountMainInvestorInfo> updateInvestorAcctList = new ArrayList<>();

    /**
     * 实时处理的资金方交易账户
     */
    private List<AmAccountMainInvestorInfo> dealInvestorAcctList = new ArrayList<>();

    /**
     * 需要保存的资金方累计账户
     */
    private List<AmInterestAccrualInvestorInfo> saveInvestorAccuAcctList = new ArrayList<>();

    /**
     * 需要更新的资金方累计账户
     */
    private List<AmInterestAccrualInvestorInfo> updateInvestorAccuAcctList = new ArrayList<>();

    /**
     * 实时处理的资金方累计账户
     */
    private List<AmInterestAccrualInvestorInfo> dealInvestorAccuAcctList = new ArrayList<>();

    /**
     * 需要保存的资金方延滞交易账户
     */
    private List<AmDelinquencyInvestorInfo> saveInvestorDelqAcctList = new ArrayList<>();

    /**
     * 需要更新的资金方延滞交易账户
     */
    private List<AmDelinquencyInvestorInfo> updateInvestorDelqAcctList = new ArrayList<>();

    /**
     * 实时处理的延滞交易账户
     */
    private List<AmDelinquencyInvestorInfo> dealInvestorDelqAcctList = new ArrayList<>();

    /**
     * 需要保存的资金方gl流水
     */
    private List<TlGlInterfaceInvestorInfo> saveInvestorGlList = new ArrayList<>();

    /**
     * 需要保存的形态转移流水
     */
    private List<TlInvestorLoanChange> saveLoanChangeList = new ArrayList<>();

    /**
     * 需要保存的封锁码流水
     */
    private List<TlCustomerBlockCode> saveBlockList = new ArrayList<>();

    /**
     * 需要保存的资金方计提日志信息
     */
    private List<TlInvestorInterestAccrualLog> saveInvestorIntrAccrualLogList = new ArrayList<>();

    public CmCustomerFirstLevel getDealCust() {
        return dealCust;
    }

    public void setDealCust(CmCustomerFirstLevel dealCust) {
        this.dealCust = dealCust;
    }

    public CmCustomerFirstLevel getUpdateCust() {
        return updateCust;
    }

    public void setUpdateCust(CmCustomerFirstLevel updateCust) {
        this.updateCust = updateCust;
    }

    public List<AmLoanMainInfo> getDealLoanMainList() {
        return dealLoanMainList;
    }

    public void setDealLoanMainList(List<AmLoanMainInfo> dealLoanMainList) {
        this.dealLoanMainList = dealLoanMainList;
    }



    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmRepaymentPlanInfo> getSavePlanList() {
        return savePlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmWaiveRepaymentPlanInfo> getSaveWaivePlanList() {
        return saveWaivePlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmAccountMainInfo> getSaveAcctList() {
        return saveAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmInterestAccrualInfo> getSaveAccuAcctList() {
        return saveAccuAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmDelinquencyInfo> getSaveDelqAcctList() {
        return saveDelqAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlGlInterfaceInfo> getSaveGlList() {
        return saveGlList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlLoanClassifyChange> getSaveClassifyList() {
        return saveClassifyList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlTransactionInfo> getSaveTlTransList() {
        return saveTlTransList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlInterestAccrualLog> getSaveIntrAccrualLogList() {
        return saveIntrAccrualLogList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmRepaymentPlanInvestorInfo> getSaveInvestorPlanList() {
        return saveInvestorPlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmAccountMainInvestorInfo> getSaveInvestorAcctList() {
        return saveInvestorAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmInterestAccrualInvestorInfo> getSaveInvestorAccuAcctList() {
        return saveInvestorAccuAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<AmDelinquencyInvestorInfo> getSaveInvestorDelqAcctList() {
        return saveInvestorDelqAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlGlInterfaceInvestorInfo> getSaveInvestorGlList() {
        return saveInvestorGlList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlInvestorLoanChange> getSaveLoanChangeList() {
        return saveLoanChangeList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlInvestorInterestAccrualLog> getSaveInvestorIntrAccrualLogList() {
        return saveInvestorIntrAccrualLogList;
    }

    @MethodType(CommonContants.METHOD_TYPE_SAVE)
    public List<TlCustomerBlockCode> getSaveBlockList() {
        return saveBlockList;
    }


    /**
     * update 方法区
     *
     */
    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmLoanAccountInfo> getUpdateLoanAccountList() {
        return updateLoanAccountList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmRepaymentPlanInfo> getUpdatePlanList() {
        return updatePlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmWaiveRepaymentPlanInfo> getUpdateWaivePlanList() {
        return updateWaivePlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmAccountMainInfo> getUpdateAcctList() {
        return updateAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmInterestAccrualInfo> getUpdateAccuAcctList() {
        return updateAccuAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmDelinquencyInfo> getUpdateDelqAcctList() {
        return updateDelqAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmLoanAccountInvestorInfo> getUpdateInvestorLoanAccountList() {
        return updateInvestorLoanAccountList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmRepaymentPlanInvestorInfo> getUpdateInvestorPlanList() {
        return updateInvestorPlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmAccountMainInvestorInfo> getUpdateInvestorAcctList() {
        return updateInvestorAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmInterestAccrualInvestorInfo> getUpdateInvestorAccuAcctList() {
        return updateInvestorAccuAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_UPDATE)
    public List<AmDelinquencyInvestorInfo> getUpdateInvestorDelqAcctList() {
        return updateInvestorDelqAcctList;
    }

    /**
     * deal 方法区
     *
     */
    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmLoanAccountInfo> getDealLoanAccountList() {
        return dealLoanAccountList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmRepaymentPlanInfo> getDealPlanList() {
        return dealPlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmWaiveRepaymentPlanInfo> getDealWaivePlanList() {
        return dealWaivePlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmAccountMainInfo> getDealAcctList() {
        return dealAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmInterestAccrualInfo> getDealAccuAcctList() {
        return dealAccuAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmDelinquencyInfo> getDealDelqAcctList() {
        return dealDelqAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmLoanMainInvestorInfo> getDealInvestorLoanMainList() {
        return dealInvestorLoanMainList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmLoanAccountInvestorInfo> getDealInvestorLoanAccountList() {
        return dealInvestorLoanAccountList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmRepaymentPlanInvestorInfo> getDealInvestorPlanList() {
        return dealInvestorPlanList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmAccountMainInvestorInfo> getDealInvestorAcctList() {
        return dealInvestorAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmInterestAccrualInvestorInfo> getDealInvestorAccuAcctList() {
        return dealInvestorAccuAcctList;
    }

    @MethodType(CommonContants.METHOD_TYPE_DEAL)
    public List<AmDelinquencyInvestorInfo> getDealInvestorDelqAcctList() {
        return dealInvestorDelqAcctList;
    }


    public void setSaveLoanAccountList(List<AmLoanAccountInfo> saveLoanAccountList) {
        if (CollectionUtils.isNotEmpty(saveLoanAccountList)) {
            this.saveLoanAccountList.addAll(saveLoanAccountList);
        }
    }

    public void setDealLoanAccountList(List<AmLoanAccountInfo> dealLoanAccountList) {
        if (CollectionUtils.isNotEmpty(dealLoanAccountList)) {
            this.dealLoanAccountList.addAll(dealLoanAccountList);
        }
    }

    public void setSavePlanList(List<AmRepaymentPlanInfo> savePlanList) {
        if (CollectionUtils.isNotEmpty(savePlanList)) {
            this.savePlanList.addAll(savePlanList);
        }
    }

    public void setDealPlanList(List<AmRepaymentPlanInfo> dealPlanList) {
        if (CollectionUtils.isNotEmpty(dealPlanList)) {
            this.dealPlanList.addAll(dealPlanList);
        }
    }

    public void setSaveWaivePlanList(List<AmWaiveRepaymentPlanInfo> saveWaivePlanList) {
        if (CollectionUtils.isNotEmpty(saveWaivePlanList)) {
            this.saveWaivePlanList.addAll(saveWaivePlanList);
        }
    }

    public void setDealWaivePlanList(List<AmWaiveRepaymentPlanInfo> dealWaivePlanList) {
        if (CollectionUtils.isNotEmpty(dealWaivePlanList)) {
            this.dealWaivePlanList.addAll(dealWaivePlanList);
        }
    }

    public void setSaveAcctList(List<AmAccountMainInfo> saveAcctList) {
        if (CollectionUtils.isNotEmpty(saveAcctList)) {
            this.saveAcctList.addAll(saveAcctList);
        }
    }

    public void setDealAcctList(List<AmAccountMainInfo> dealAcctList) {
        if (CollectionUtils.isNotEmpty(dealAcctList)) {
            this.dealAcctList.addAll(dealAcctList);
        }
    }

    public void setSaveAccuAcctList(List<AmInterestAccrualInfo> saveAccuAcctList) {
        if (CollectionUtils.isNotEmpty(saveAccuAcctList)) {
            this.saveAccuAcctList.addAll(saveAccuAcctList);
        }
    }

    public void setDealAccuAcctList(List<AmInterestAccrualInfo> dealAccuAcctList) {
        if (CollectionUtils.isNotEmpty(dealAccuAcctList)) {
            this.dealAccuAcctList.addAll(dealAccuAcctList);
        }
    }

    public void setSaveDelqAcctList(List<AmDelinquencyInfo> saveDelqAcctList) {
        if (CollectionUtils.isNotEmpty(saveDelqAcctList)) {
            this.saveDelqAcctList.addAll(saveDelqAcctList);
        }
    }

    public void setDealDelqAcctList(List<AmDelinquencyInfo> dealDelqAcctList) {
        this.dealDelqAcctList = dealDelqAcctList;
    }

    public void setSaveGlList(List<TlGlInterfaceInfo> saveGlList) {
        if (CollectionUtils.isNotEmpty(saveGlList)) {
            this.saveGlList.addAll(saveGlList);
        }
    }

    public void setSaveClassifyList(List<TlLoanClassifyChange> saveClassifyList) {
        if (CollectionUtils.isNotEmpty(saveClassifyList)){
            this.saveClassifyList.addAll(saveClassifyList);
        }
    }

    public void setSaveTlTransList(List<TlTransactionInfo> saveTlTransList) {
        if (CollectionUtils.isNotEmpty(saveTlTransList)) {
            this.saveTlTransList.addAll(saveTlTransList);
        }
    }

    public void setSaveIntrAccrualLogList(List<TlInterestAccrualLog> saveIntrAccrualLogList) {
        if (CollectionUtils.isNotEmpty(saveIntrAccrualLogList)) {
            this.saveIntrAccrualLogList.addAll(saveIntrAccrualLogList);
        }
    }

    public void setDealInvestorLoanMainList(List<AmLoanMainInvestorInfo> dealInvestorLoanMainList) {
        if (CollectionUtils.isNotEmpty(dealInvestorLoanMainList)) {
            this.dealInvestorLoanMainList.addAll(dealInvestorLoanMainList);
        }
    }

    public void setSaveInvestorLoanAccountList(List<AmLoanAccountInvestorInfo> saveInvestorLoanAccountList) {
        if (CollectionUtils.isNotEmpty(saveInvestorLoanAccountList)) {
            this.saveInvestorLoanAccountList.addAll(saveInvestorLoanAccountList);
        }
    }

    public void setDealInvestorLoanAccountList(List<AmLoanAccountInvestorInfo> dealInvestorLoanAccountList) {
        if (CollectionUtils.isNotEmpty(dealInvestorLoanAccountList)) {
            this.dealInvestorLoanAccountList.addAll(dealInvestorLoanAccountList);
        }
    }

    public void setSaveInvestorPlanList(List<AmRepaymentPlanInvestorInfo> saveInvestorPlanList) {
        if (CollectionUtils.isNotEmpty(saveInvestorPlanList)) {
            this.saveInvestorPlanList.addAll(saveInvestorPlanList);
        }
    }

    public void setDealInvestorPlanList(List<AmRepaymentPlanInvestorInfo> dealInvestorPlanList) {
        if (CollectionUtils.isNotEmpty(dealInvestorPlanList)) {
            this.dealInvestorPlanList.addAll(dealInvestorPlanList);
        }
    }

    public void setSaveInvestorAcctList(List<AmAccountMainInvestorInfo> saveInvestorAcctList) {
        if (CollectionUtils.isNotEmpty(saveInvestorAcctList)) {
            this.saveInvestorAcctList.addAll(saveInvestorAcctList);
        }
    }

    public void setDealInvestorAcctList(List<AmAccountMainInvestorInfo> dealInvestorAcctList) {
        if (CollectionUtils.isNotEmpty(dealInvestorAcctList)) {
            this.dealInvestorAcctList.addAll(dealInvestorAcctList);
        }
    }

    public void setSaveInvestorAccuAcctList(List<AmInterestAccrualInvestorInfo> saveInvestorAccuAcctList) {
        if (CollectionUtils.isNotEmpty(saveInvestorAccuAcctList)) {
            this.saveInvestorAccuAcctList.addAll(saveInvestorAccuAcctList);
        }
    }

    public void setDealInvestorAccuAcctList(List<AmInterestAccrualInvestorInfo> dealInvestorAccuAcctList) {
        if (CollectionUtils.isNotEmpty(dealInvestorAccuAcctList)) {
            this.dealInvestorAccuAcctList.addAll(dealInvestorAccuAcctList);
        }
    }

    public void setSaveInvestorDelqAcctList(List<AmDelinquencyInvestorInfo> saveInvestorDelqAcctList) {
        if (CollectionUtils.isNotEmpty(saveInvestorDelqAcctList)) {
            this.saveInvestorDelqAcctList.addAll(saveInvestorDelqAcctList);
        }
    }

    public void setDealInvestorDelqAcctList(List<AmDelinquencyInvestorInfo> dealInvestorDelqAcctList) {
        if (CollectionUtils.isNotEmpty(dealInvestorDelqAcctList)) {
            this.dealInvestorDelqAcctList.addAll(dealInvestorDelqAcctList);
        }
    }

    public void setSaveInvestorGlList(List<TlGlInterfaceInvestorInfo> saveInvestorGlList) {
        if (CollectionUtils.isNotEmpty(saveInvestorGlList)) {
            this.saveInvestorGlList.addAll(saveInvestorGlList);
        }
    }

    public void setSaveLoanChangeList(List<TlInvestorLoanChange> saveLoanChangeList) {
        if (CollectionUtils.isNotEmpty(saveLoanChangeList)) {
            this.saveLoanChangeList.addAll(saveLoanChangeList);
        }
    }

    public void setSaveInvestorIntrAccrualLogList(List<TlInvestorInterestAccrualLog> saveInvestorIntrAccrualLogList) {
        if (CollectionUtils.isNotEmpty(saveInvestorIntrAccrualLogList)) {
            this.saveInvestorIntrAccrualLogList.addAll(saveInvestorIntrAccrualLogList);
        }
    }

    public void setSaveBlockList(List<TlCustomerBlockCode> saveBlockList) {
        if (CollectionUtils.isNotEmpty(saveBlockList)){
            this.saveBlockList.addAll(saveBlockList);
        }
    }
}
